# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kdeplasma-addons
pkgver=6.2.3
pkgrel=0
pkgdesc="All kind of addons to improve your Plasma experience"
# armhf blocked by qt6-qtdeclarative
# ppc64le, s390x and riscv64 blocked by qt6-qtwebengine
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="LGPL-2.0-only AND GPL-2.0-or-later"
depends="purpose"
depends_dev="
	icu-dev
	karchive-dev
	kcmutils-dev
	kconfig-dev
	kcoreaddons-dev
	kdeclarative-dev
	kholidays-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knewstuff-dev
	knotifications-dev
	krunner-dev
	kservice-dev
	kunitconversion-dev
	kwindowsystem-dev
	networkmanager-qt-dev
	libplasma-dev
	plasma5support-dev>=$pkgver
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	sonnet-dev
	"
case "$CARCH" in
	x86|x86_64|armhf|armv7|aarch64)
		depends_dev="$depends_dev qt6-qtwebengine-dev" ;;
esac
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"

case "$pkgver" in
*.90*) _rel=unstable ;;
*) _rel=stable ;;
esac
_repo_url="https://invent.kde.org/plasma/kdeplasma-addons.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/kdeplasma-addons-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# converterrunnertest is broken
	# datetimerunnertest requires running Wayland session
	xvfb-run -a ctest --test-dir build --output-on-failure -E "(converterrunner|datetimerunner)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f6c4b22dd6588b2ce1dc500503e08d11c9bfa49a1ff65185b60e1d2dae85e4c10e7bfb43fa0d5a9b379b6c22f2ccdcd40e4c2087f555fe18f07f6971fa686e80  kdeplasma-addons-6.2.3.tar.xz
"
